// createApp，创建app应用实例
import { createApp } from 'vue'
import pinia from './stores/stores'

import App from './App.vue'
import router from './router'
import { setupElementPlus } from './utils/elementPlus/elementPlus'
import { setupI18n } from './utils/i18n/i18n'
import { setupAxios } from './utils/axios/request'
import svgIcon from './components/svgIcon/svgIcon.vue'
import '@/assets/css/reset.scss'
import '@/assets/css/global.css'

//这是虚拟模块的引入方式，用于给脚手架插件在打包和开发时做相应的处理。
//Vite 和 Rollup 中都约定以 virtual: 作为虚拟模块的前缀：
import 'virtual:svg-icons-register'

const app = createApp(App)

app.use(pinia)
app.use(router)

setupElementPlus(app)
setupI18n(app)
setupAxios(app)

console.log(import.meta.env)

app.component('SvgIcon', svgIcon)

// 将app对象挂载到#app的dom元素上
app.mount('#app')
